// utils/devElValidateForm.ts
import { useFormItem } from 'element-plus';
import { debugWarn } from 'element-plus/es/utils/error';

let formItem: ReturnType<typeof useFormItem>['formItem'];

export const initDevElValidateForm = () => {
    const res = useFormItem();
    formItem = res.formItem;
};

export const devElValidateForm = (type: 'change' | 'blur') => {
    formItem?.validate(type).catch((err) => debugWarn(err));
};
